# Maintainer: Evangelos Foutras <evangelos@foutrelis.com>
# Contributor: Ionut Biru <ibiru@archlinux.org>

pkgname=farstream-0.1
_pkgname=farstream
pkgver=0.1.2
pkgrel=5
pkgdesc="Audio/Video Communications Framework (legacy version)"
arch=('x86_64')
url="http://www.freedesktop.org/wiki/Software/Farstream"
license=('LGPL2.1')
depends=('libnice' 'gstreamer0.10-base' 'gstreamer0.10-bad-plugins' 'gstreamer0.10-good-plugins' 'gstreamer0.10-ffmpeg')
makedepends=('gobject-introspection' 'gstreamer0.10-python' 'python2-gobject2' 'git' 'gtk-doc')
source=(git://git.collabora.co.uk/git/farstream.git#commit=54e28e95bed4f04bc95dae509c3724399c79fa29
        farstream-0.1.2-prefer-vp8.patch
        farstream-rtp-session.patch
        codec-discovery-intersect.patch
        intersect-instead-of-merge.patch
        rtp-memleak.patch
        fix-crash.patch)
sha256sums=('SKIP'
            '5f8f2876bde0f21383b3d059c94914a2fcd63d45a1bb1b5cd2e2208cd2536da5'
            '30e95a24800a26ff84e0cffeccb525e704fab6024402cd1d3e7fd957909650bf'
            '385d7c72e269bf48bd41937442d819a1e6d0f2472b903670a8a5555f5cb96586'
            'c3988f90fc50ee557399b240de78f3fb4fe191f339143f6943b963c2e0fddaf2'
            'b966312ccad90dd30b78ee2df49e9637b3b573e498668bcc58ac208f254440db'
            '8fde8f5fb16475aabeda2d6e48c86b105341fd72cde02cd6655ca7f41b4a98ed')

prepare() {
  cd farstream
  patch -Np1 -i ../farstream-0.1.2-prefer-vp8.patch
  patch -Np1 -i ../farstream-rtp-session.patch
  patch -Np1 -i ../intersect-instead-of-merge.patch
  patch -Np1 -i ../codec-discovery-intersect.patch
  patch -Np1 -i ../rtp-memleak.patch
  patch -Np1 -i ../fix-crash.patch
  sed -i -e 's/AC_INIT(Farstream, 0.1.2.1/AC_INIT(Farstream, 0.1.2/' configure.ac
}

check() {
  cd farstream
  # MSN test fails because of missing libmimic + mimenc element
  make check || return 0
}
build() {
  cd farstream
  NOCONFIGURE=1 ./autogen.sh
  ./configure \
    --prefix=/usr \
    --with-package-name='Arch Linux Farstream 0.1 Package' \
    --with-package-origin='https://www.archlinux.org/' \
    --disable-gtk-doc --disable-static
  make -j1
}

package() {
  cd farstream
  make DESTDIR="$pkgdir" install
}

# vim:set ts=2 sw=2 et:
